package com.woniu.day8.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.woniu.day8.pojo.Menu;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface MenuMapper extends BaseMapper<Menu> {
    @Select("SELECT * FROM t_menu m \n" +
            "JOIN t_role_menu rm ON m.mid = rm.mid \n" +
            "JOIN t_role r ON r.rid = rm.rid \n" +
            "JOIN t_user_role ur ON ur.rid = r.rid \n" +
            "JOIN userinfo u ON u.id=ur.uid \n" +
            "WHERE u.id = #{id}")
     List<Menu> SelectMenu( Integer id);
}
